package book;

public class BookList {
    private Book[] books = new Book[100];
    private int usedSize; // 实际书的个数

    public BookList(){
        // 默认已经存在的书
        books[0] = new Book("你当像鸟飞往你的山","塔拉","小说",59);
        books[1] = new Book("活着","余华","小说",38);
        books[2] = new Book("红楼梦","曹雪芹","小说",78);
        this.usedSize = 3;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book books) {
        this.books[pos] = books;
    }

    public Book[] getBooks(){
        return books;
    }
}
